import http from "@/api";
// 定义响应数据的接口
interface ApiResponse {
  code: number;
  msg: string;
  data?: any; // 如果有其他数据字段，可以在这里定义
}
// 注册(新增用户)
export const Register = (data): Promise<AxiosResponse> => {
  return http({
    url: "/dapp/index/userInc",
    method: "post",
    data,
  });
};

// 登录
export const Login = (data): Promise<AxiosResponse> => {
  return http({
    url: "/dapp/index/checkUser",
    method: "post",
    data,
  });
};

// 检查当前语言
export const DetecLang = (): Promise<AxiosResponse> => {
  return http({
    url: "/dapp/Languge/checkLang",
    method: "get",
  });
};

// 切换语言
export const ChangeLang = (params): Promise<AxiosResponse> => {
  return http({
    url: "/dapp/Languge/changeLang",
    method: "get",
    params,
  });
};
